import pandas as pd
from flask import Flask, render_template

# 散点
df = pd.read_csv("data/北京每个小时空气质量.csv")
timestamp = df['时间戳'].tolist()
pm = df['PM2_5'].tolist()

# 雷达图
df = pd.read_csv("data/中国疫情.csv")
df = df.head(2)
tw = df.values[0][2:]
hb = df.values[1][2:]


app = Flask(__name__)


@app.route("/")
def index():
    # 渲染模板的同时将数据传输进去
    return render_template("雷达和散点图.html", timestamp=timestamp, pm=pm, tw=tw, hb=hb)


if __name__ == '__main__':
    app.run(debug=True)
